<div id="notes">
<script src="/js/plugins/validation/jquery.validate.min.js"></script>
<script src="/js/plugins/validation/additional-methods.min.js"></script>

<script>

    $(document).ready(function() {
        $('.scrollable').slimScroll({
            height: '250px'
        });
    });
</script>

    <div class="box">
        <div class="box-title">
            <h3>
                <i class="icon-table"></i>
                Últimas Notas
            </h3>
            <div class="actions">
                <a href="#modal-storeNotes" role="button" class="btn" data-toggle="modal">
                    <button class="btn btn-primary">
                        <i class="icon-plus"></i>
                    </button>
                </a>
            </div>
        </div>
        <div  class="box-content nopadding scrollable" data-height="300">

            <table class="table table-hover table-nomargin table-condensed">
                <thead>
                    <tr>
                        <th>Comentario</th>
                        <th>Autor</th>
                        <th>Fecha</th>
                        <th>Estado</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($notes as $value) { ?>
                    <tr>
                            <td><?php echo $value['coments']; ?></td>
                            <td><?php echo $value['Users']['name']; ?></td>
                            <td><?php echo $value['note_date']; ?></td>
                            <td>
                                <a href="#" >
                                    <button class="btn btn-<?php echo ($value['active']) ? 'danger' : 'success'; ?>" onclick="NotesInfomationsActive(<?php echo $value['id_note']; ?>,<?php echo $value['active']; ?>,<?php echo $value['id_store']; ?>);">
                                        <i class="icon-thumbs-<?php echo ($value['active']) ? 'down' : 'up'; ?>"></i>
                                    </button>
                                </a>
                            </td>
                        </tr>

                    <?php } ?>

                </tbody>
            </table>
            <form action="#" method="POST" class='form-horizontal form-validate' id="storeNotes">
                <input type="hidden" name="id_store" value="<?php echo $notes[0]['id_store']; ?>" />

                <div id="modal-storeNotes" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h3 id="myModalLabel">Agregar Nota Local</h3>
                    </div>
                    <div class="modal-body">
                        <div class="control-group">
                            <label for="select" class="control-label">Seleccione Categoria</label>
                            <div class="controls">
                                <select name="category" id="select" class='input-large'  data-rule-required="true"  data-msg-required="Debe Seleccionar la Categoría">
                                    <option value="">Seleccione Categoria</option>
                                    <?php
                                    //
                                    foreach ($categorys as $value) {
                                        ?>
                                        <option value="<?php echo $value['id_category']; ?>"><?php echo $value['name']; ?></option>
                                    <?php }
                                    ?>
                                </select>
                            </div>
                        </div>

                        <div class="control-group">
                            <label for="textarea" class="control-label">Comentarios</label>
                            <div class="controls">
                                <textarea name="coments" id="textarea" class="input-block-level" data-rule-required="true"  data-msg-required="Debe Ingresar el Comentario"></textarea>
                            </div>
                        </div>

                        <br>
                        <br>

                    </div>
                    <div class="modal-footer">
                        <input type="button" class="btn btn-primary" value="Submit" onclick="if ($('#storeNotes').valid()){addStoreNotes();}">
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>